# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-instagramapi
pkgname=('python2-instagramapi' 'python-instagramapi')
_pkgname=InstagramAPI
pkgver=1.0.2
pkgrel=7
pkgdesc='Unofficial instagram API, give you access to ALL instagram features.'
arch=('any')
url='https://pypi.org/project/InstagramAPI/#files'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('8f9905caaa39843ed28d3c104c4f16c5874f2ab72c82ebf9607fd6f18b0ff1998b46c679e381e0cb1dcabd629cda7df035e0914cac5ceab8ce2dbd5237bc61ab')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-instagramapi() {
  depends=('python2-requests' 'python2-requests' 'python2-requests-toolbelt'
           'python2-moviepy')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-instagramapi() {
  depends=('python-requests' 'python-requests' 'python-requests-toolbelt'
           'python-moviepy')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

